import { createRouter, createWebHashHistory } from 'vue-router'
// import Index from '../views/Index.vue'

const routes = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/index',
    name: 'Index',
    // component: Index
    component: () => import('@/views/Index.vue')
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('@/views/Login.vue')
  },
  {
    path:'/register',
    name:'Register',
    component:()=>import('@/views/Register.vue')
  },
  
  {
    path:'/businessList',
    name:'BusinessList',
    component:()=>import('@/views/BusinessList.vue')
  },
  {
    path:'/businessInfo',
    name:'BusinessInfo',
    component:()=>import('@/views/BusinessInfo.vue')
  },
  {
    path:'/payment',
    name:'Payment',
    component:()=>import('@/views/Payment.vue')
  },
  {
    path:'/order',
    name:'Order',
    component:()=>import('@/views/Order.vue')
  },
  {
    path:'/paySuccess',
    name:'PaySuccess',
    component:()=>import('@/views/PaySuccess.vue')
  },

  {
    path:'/cartDetails',
    name:'CartDetails',
    component:()=>import('@/views/CartDetails.vue')
  },

  {
    path:'/addressInfo',
    name:'AddressInfo',
    component:()=>import('@/views/AddressInfo.vue')
  },
  
  {
    path: '/orderList',
    component: () => import('@/views/myorder'),
  },
  {
    path: '/orderDetail/:orderId',
    component: () => import('@/views/OrderDetail')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
